package com.zhuiyun.project.api.article.service;

import com.zhuiyun.project.api.article.model.ArticleModel;
import com.zhuiyun.project.common.errorCode.CommonException;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.pageUtil.PageRequest;
import com.zhuiyun.project.utils.pageUtil.PageResult;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @InterfaceName ArticleService
 * @Description TODO 文章管理业务逻辑层
 * @Author 杨友朋
 * @Date 2023/11/15 15:23
 **/
public interface ArticleService {
    /**
     * @Author 杨友朋
     * @Description 查询文章
     * @Date 2023/11/16 9:24
     * @Return PageResult
     * @param articleModel，pageRequest
     */
    PageResult selectArticle(ArticleModel articleModel, PageRequest pageRequest);

    /**
     * @Author 杨友朋
     * @Description 单查查询文章
     * @Date 2023/11/16 9:24
     * @Return CommonResult
     * @param id
     */
    CommonResult selectArticleById(Integer id);

    /**
    * @Author 杨友朋
    * @Description 删除文章
    * @Date 2023/11/16 9:36
    * @Return CommonResult
    * @param articleIds
    */
    CommonResult deleteArticle(Integer articleIds);

    /**
     * @Author 杨友朋
     * @Description 修改文章状态
     * @Date 2023/11/16 9:36
     * @Return CommonResult
     * @param articleModel
     */
    CommonResult changeArticleStatus(ArticleModel articleModel);

    /**
     * @Author 杨友朋
     * @Description 添加文章
     * @Date 2023/11/17 13:55
     * @Return CommonResult
     * @param file,articleModel
     */
    CommonResult addArticle(MultipartFile file, ArticleModel articleModel) throws CommonException;

    /**
     * @Author 杨友朋
     * @Description 修改文章
     * @Date 2023/11/17 16:47
     * @Return CommonResult
     * @param file,articleModel
     */
    CommonResult updateArticle(MultipartFile file, ArticleModel articleModel) throws CommonException;
}
